<?php
class Terms extends CActiveRecord {
	public static function model($className = __CLASS__) {
		return parent::model($className);
	}

	public function tableName() {
		return strtolower('Terms');
	}
	
	public function rules() {
		return array(
			array('name', 'required'),
			array('name', 'length', 'max' => 200)
		);
	}
	
	public function safeAtrributes() {
		return array('name');
	}

	public function relations() {
		return array(
			'taxonomy' => array(self::HAS_MANY, 'TermsTaxonomy', 'termId',
				'joinType' => 'INNER JOIN',
				'together' => true
			)
		);
	}
}
